﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DBUtility;//Please add references
namespace TierApplication
{
    /// <summary>
    /// 类c_Depot。
    /// </summary>
    [Serializable]
    public partial class c_Depot
    {
        public c_Depot()
        { }
        #region Model
        private string _depotid;
        private string _depotname;
        /// <summary>
        /// 
        /// </summary>
        public string DepotID
        {
            set { _depotid = value; }
            get { return _depotid; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string DepotName
        {
            set { _depotname = value; }
            get { return _depotname; }
        }
        #endregion Model


        #region  Method


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public void GetModel(string DepotID)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select DepotID,DepotName ");
            strSql.Append(" FROM [c_Depot] ");
            strSql.Append(" where DepotID=@DepotID ");
            SqlParameter[] parameters = {
					new SqlParameter("@DepotID", SqlDbType.VarChar,10)};
            parameters[0].Value = DepotID;
     
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["DepotID"] != null)
                {
                    this.DepotID = ds.Tables[0].Rows[0]["DepotID"].ToString();
                }
                if (ds.Tables[0].Rows[0]["DepotName"] != null)
                {
                    this.DepotName = ds.Tables[0].Rows[0]["DepotName"].ToString();
                }
            }
        }

        #endregion  Method
    }
}

